package com.stark.commons.spring.web.boot.config;

import com.dtflys.forest.config.ForestConfiguration;
import com.stark.commons.spring.web.support.forest.converter.DefaultAutoConverter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Forest 自动配置。
 *
 * @author Ben
 * @version 1.0.0
 * @since 2023/8/5
 */
@Configuration
@ConditionalOnClass(name = "com.dtflys.forest.converter.auto.DefaultAutoConverter")
public class ForestAutoConfig {

    @Bean
    public DefaultAutoConverter defaultAutoConverter(ForestConfiguration configuration) {
        return new DefaultAutoConverter(configuration);
    }

}
